1. Field of the Invention
This invention generally relates to electronic circuits implemented with transistors and, more particularly, to a system and method for adjusting the threshold voltage of a comparator circuit in response to changes in the dc level of an input signal that is being compared to the threshold.
2. Description of the Related Art
FIG. 1 is a schematic diagram of a conventional comparator circuit (prior art). The circuit compares an ac signal to a threshold voltage and generates an output signal when the ac signal exceeds the threshold voltage. This particular circuit uses a lowpass filter to integrate the ac signal, so that the threshold voltage is the same as the input signal average voltage. If the dc level of the input signal changes, or if the ac signal becomes saturated or distorted, in response to a change in temperature or a variation in the supply voltage for example, the circuit will track the changes in the input signal average voltage. If the dc level of the input signal decreases, the threshold voltage decreases.
However, the above circuit is only of value if an approximately mid-level threshold voltage is required. That is, the lowpass filter supplies an approximately 2.5 volt threshold in response to a 5 volt (zero to 5 volt swing) input signal. If a 1 volt threshold is desired, it cannot be generated by the lowpass filter. Even if a resistive voltage divider is added between the lowpass filter and the comparator threshold input, to divide the voltage from 2.5 volts to 1 volt (in ideal conditions), the divider will also act to divide any compensation to the 1 volt threshold as the input signal varies from the ideal condition. Thus, the corrections are non-linear.
It would be advantageous if a comparator threshold voltage could be compensated for changes in the input signal dc level or average voltage.
It would be advantageous if the above-mentioned compensation could be performed at any threshold level.
The present invention compensation circuit tracks changes in the average voltage of a signal being input to a comparator for comparison to a threshold voltage. The comparator can be calibrated to operate at a predetermined threshold level and the tracked changes are used to modify the comparator threshold level, after calibration. The present invention compensation circuit linearly performs the modifications to any level of threshold voltage. That is, the threshold level is not restricted to the approximately mid-voltage level described in the explanation of FIG. 1.
Accordingly, a method is provided for compensating a comparator threshold level. The method comprises: accepting an input signal with an ac component; lowpass filtering the input signal to generate the input signal average voltage; accepting the input signal average voltage; accepting a first dc level (Vopt); summing the average voltage with the first dc level; supplying a first sum (Vr1) as a first comparator threshold level; comparing the input signal to the first comparator threshold level; and, supplying a first comparator output signal with an ac component.
In some aspects of the method, accepting a first dc level includes accepting a plurality of dc levels. Then, summing the average voltage with the first dc level includes summing the average voltage with each of the plurality of dc levels. Supplying a first sum as a comparator threshold voltage includes supplying a plurality of sums as a corresponding plurality of comparator threshold levels. Comparing the input signal to the first comparator threshold level includes comparing the input signal to each of the comparator threshold levels. Finally, supplying a first comparator output signal includes supplying a plurality of comparator output signals.
Additional details of the above-described method, and a comparator compensation system are described below.